package com.design.absfactory.factory;

import com.design.absfactory.impl.AmdCpu;
import com.design.absfactory.impl.IntelCpu;
import com.design.absfactory.inter.Cpu;

/**
 * Created by Administrator on 2016/8/27.
 */
public class CpuFactory {

    /**
     *  简单工厂
     * @param type
     * @return
     */
    public static Cpu createCpu(int type) {
        Cpu cpu = null;
        if (type == 1) {
            cpu = new IntelCpu(755);
        } else if (type == 2) {
            cpu = new AmdCpu(938);
        }

        return cpu;
    }
}
